import React from 'react';
// V1 版本
import { StackNavigator } from 'react-navigation';
import TabConfigs from './TabConfigs';
import CardStackStyleInterpolator from "react-navigation/src/views/StackView/StackViewStyleInterpolator";

const pages = {
	// Home: {screen: Home},
};

/**
 * 注册导航
 */
const Navigator = StackNavigator({
		...TabConfigs,
		...pages
	},
	{
		initialRouteName: '',
		mode: 'card',
		onTransitionStart: () => { },  // 回调
		onTransitionEnd: () => { },  // 回调
		headerMode: 'float',
		transitionConfig: () => ({
			screenInterpolator: CardStackStyleInterpolator.forHorizontal,
		}),
		navigationOptions: () => ({
			gesturesEnabled: true,
			headerBackTitle: null,
			headerTitleStyle: {
				alignItems: 'center',
				color: 'black',
				paddingTop: 3,
				fontSize: 20,
				alignSelf: 'center',
				fontWeight: 'normal',
			},
			headerStyle: {
				elevation: 1,
				backgroundColor: '#888',
				shadowOpacity: 0,
				borderBottomWidth: 0,
			},
			headerTintColor: 'green',
		})
	}
);

/**
 * 导出当前Module
 */
module.exports = Navigator;